#!/bin/bash

# 设置颜色输出
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'

# 运行单元测试
echo -e "${GREEN}Running unit tests...${NC}"
go test ./internal/... -v -cover

# 运行集成测试
echo -e "\n${GREEN}Running integration tests...${NC}"
go test ./tests/integration/... -v

# 检查测试结果
if [ $? -eq 0 ]; then
    echo -e "\n${GREEN}All tests passed!${NC}"
    exit 0
else
    echo -e "\n${RED}Tests failed!${NC}"
    exit 1
fi 